{% macro tutorial_chapter_tree(chapters, chapterId, index) %}
	{% if chapters is not empty %}
		<ul class="nav nav-pills {% if  index == 0 %} nav-vertical {% else %} show {% endif %}">
			{% for chapter in chapters %}
				<li class="nav-item" data-id="{{ chapter['id'] }}">
					<a href="{{ path("app_tutorial_detail", {"id":chapter['tutorialId'], "chapterId":chapter['id']}) }}" class="nav-link {% if chapter['id']== chapterId %} active {% endif %}">{{ chapter['name'] }}</a>
					{{ _self.tutorial_chapter_tree(chapter['childs'], chapterId, loop.index) }}
				</li>
			{% endfor %}
		</ul>
	{% endif %}
{% endmacro %}
